const importGroupTemplate =
    `
<el-dialog
        title="导入"
        :visible.sync="visible"
        width="420px">
    <p>{{group.name}}</p>
    <el-upload
        class="upload-demo"
        drag
        action=""
        :auto-upload="false"
        :multiple="false"
        :http-request="() => console.log('xxx')"
        :on-change="onFileChange"
        :on-remove="onFileRemove"
        accept="application/json"
        limit="1"
    >
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
        <div class="el-upload__tip" slot="tip">只能上传json文件，且格式要与本系统导出的格式一致</div>
    </el-upload>
    <span slot="footer" class="dialog-footer">
        <el-button @click="closeDialog">取 消</el-button>
        <el-button type="primary" @click="importGroup">确 定</el-button>
    </span>
</el-dialog>
`

Vue.component('import-group', {
    props: {
        group: Object,
        closeDialog: Function,
        visible: Boolean
    },
    data: function () {
        return {
            fileList: []
        }
    },
    computed: {
    },
    watch: {
    },
    methods: {
        onFileChange: function (file, fileList) {
            this.fileList = fileList
        },
        onFileRemove: function (file, fileList) {
            this.fileList = fileList
        },

        importGroup: async function (override) {
            if (override) {
            }
            this.$message({
                message: '暂未实现',
                type: 'warning'
            })
        }
    },
    template: importGroupTemplate
})
